package com.cn.serverline.lineicp.workshopPlan.controller;

import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import javax.annotation.Resource;

import com.cn.serverline.lineicp.workshopPlan.entity.PlanLineAssembleSplit;
import com.cn.serverline.lineicp.workshopPlan.service.IPlanLineAssembleSplitService;
import org.springframework.validation.annotation.Validated;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * 周部装组件拆分表 接口
 *
 * @author 田江余
 * @since 2024-08-12
 */
@RestController
@ApiResource(name = "周部装组件拆分表的接口")
public class PlanLineAssembleSplitController {

    @Resource(name = "PlanLineAssembleSplitServiceImpl")
    private IPlanLineAssembleSplitService iPlanLineAssembleSplitService;

    /**
     * 添加周部装组件拆分表
     */
    @PostResource(name = "添加周部装组件拆分表", path = "/workshopPlan/planLineAssembleSplit/add")
    public ResponseData<PlanLineAssembleSplit> add(@RequestBody @Validated PlanLineAssembleSplit planLineAssembleSplit){
        iPlanLineAssembleSplitService.add(planLineAssembleSplit);
        return new SuccessResponseData<>();
    }

    /**
     * 删除周部装组件拆分表 撤回
     */
    @PostResource(name = "删除周部装组件拆分表", path = "/workshopPlan/planLineAssembleSplit/delete")
    public ResponseData<?> delete(@RequestBody @Validated PlanLineAssembleSplit  planLineAssembleSplit){
        iPlanLineAssembleSplitService.del(planLineAssembleSplit);
        return new SuccessResponseData<>();
    }

    /**
     * 编辑周部装组件拆分表
     */
    @PostResource(name = "编辑周部装组件拆分表", path = "/workshopPlan/planLineAssembleSplit/edit")
    public ResponseData<?> edit(@RequestBody @Validated PlanLineAssembleSplit planLineAssembleSplit) {
        iPlanLineAssembleSplitService.edit(planLineAssembleSplit);
        return new SuccessResponseData<>();
    }

    /**
     * 分页查询-周部装组件拆分表列表
     */
    @GetResource(name = "分页查询-周部装组件拆分表列表", path = "/workshopPlan/planLineAssembleSplit/page")
    public ResponseData<PageResult<PlanLineAssembleSplit>> page(PlanLineAssembleSplit planLineAssembleSplit) {
        return new SuccessResponseData<>(iPlanLineAssembleSplitService.findPage(planLineAssembleSplit));
    }

}
